package com.example.demo.entity.exception;

/**
 * @description:
 * @author: cj
 * @create: 10-03-11 10:57:07
 */
public enum EnumResult {
    //9开头的操作成功
    EX_SUCCESS_CODE( 200, "操作成功" ),
    EX_FAIL_CODE( 90101, "操作失败" ),
    EX_VIEW_NOT_EXIST( 90102, "视图不存在" ),
    EX_DATABASE_IS_EXIST( 90103, "数据库已存在" ),



    //8开头的是文章的错误
    EX_ESSAY_NO_EXIST_CODE( 80101, "文章不存在" ),

    //7开头的是请求参数错误
    EX_REQUEST_PAR_CODE( 70101, "请求参数错误" ),

    //6开头为Excel导入导出操作错误
    EX_EXCEL_ERROR_CODE2( 60102, "表结构不正确,请下载指定表" ),
    EX_EXCEL_ERROR_CODE3( 60103, "传入文件为空" ),
    EX_EXCEL_ERROR_CODE4( 60104, "文件格式错误" ),
    EX_EXCEL_ERROR_CODE5( 60105, "文件上传失败" ),
    EX_EXCEL_ERROR_CODE6( 60105, "需要导入表的不存在" ),
    EX_EXCEL_ERROR_CODE7( 60106, "excel导入数据失败" ),

    //5开头为Elasticsearch操作错误
    EX_ES_PUT_ERROR_CODE( 50101, "添加数据时Elasticsearch错误" ),
    EX_ES_DELETE_ERROR_CODE( 50102, "删除数据时Elasticsearch错误" ),
    EX_ES_POST_ERROR_CODE( 50103, "更新数据时Elasticsearch错误" ),
    EX_ES_GET_ERROR_CODE( 50104, "查询数据时Elasticsearch错误" ),
    EX_ES_BULK_ERROR_CODE( 50105, "批量操作数据时Elasticsearch错误" ),

    //4开头为Token错误
    EX_TOKEN_ERROR_CODE( 40101, "登录已过期" ),
    EX_TOKEN_ERROR_CODE2( 40102, "加密Token时程序错误" ),
    EX_TOKEN_ERROR_CODE3( 40102, "解密Token时程序错误" ),
    EX_TOKEN_ERROR_CODE4( 40103, "验证码错误" ),
    EX_TOKEN_ERROR_CODE5( 40104, "验证码已失效" ),

    //3开头用户信息错误
    EX_USER_USER_ERROR_CODE( 30101, "该用户还未注册" ),
    EX_USER_PASSWORD_ERROR_CODE( 30102, "密码错误" ),
    EX_USER_INFO_ERROR_CODE( 30111, "参数错误" ),
    EX_USER_PHONE_IS_NULL_ERROR_CODE( 30103, "手机号码不能为空" ),
    EX_USER_PHONE_ERROR_CODE( 301034, "请输入正确手机号" ),
    EX_USER_EMAIL_ERROR_CODE( 301035, "请输入正确邮箱" ),
    EX_USER_EMAIL_IS_NULL_ERROR_CODE( 301036, "邮箱不能为空" ),
    EX_USER_USER_TYPE_ERROR_CODE( 301037, "用户类型错误" ),


    //2开头的为数据库操作错误
    EX_DB_INSERT_ERROR_CODE( 20101, "添加数据时数据库错误" ),
    EX_DB_DELETE_ERROR_CODE( 20102, "删除数据时数据库错误" ),
    EX_DB_UPDATE_ERROR_CODE( 20103, "更新数据时数据库错误" ),
    EX_DB_SELECT_ERROR_CODE( 20104, "查询数据时数据库错误" ),


    EX_CHART_NULL_ERROR( 101000, "没有接收到图表配置数据" ),
    EX_CHART_PARA_NULL_ERROR( 101001, "没有接收到图表操作条件" ),
    EX_CHART_CODE_ERROR( 101002, "无效的图表类型" ),
    EX_CHART_DATA_TYPE_ERROR( 101003, "用于展示的图表数据格式错误" ),

    //1开头的为权限相关错误
    EX_NO_PERMISSION_CODE( 10101, "对不起，你没有操作权限" );
    private Integer code;
    private String msg;

    EnumResult(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
